package net.lainiao.mycost.utils;

import net.lainiao.mycost.service.*;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by Administrator on 2017/3/21.
 */
public class Page {
    @Autowired
    public IRoleInfoService roleInfoService;
    @Autowired
    public IMenuInfoService menuInfoService;
    @Autowired
    public IAnthorityService anthorityService;
    @Autowired
    public ICostInfoService costInfoService;
    @Autowired
    public IReportService reportService;
    @Autowired
    public ISalaryPaymentService salaryPaymentService;
    @Autowired
    public IUserInfoService userInfoService;
    @Autowired
    public IExpenseService expenseService;

    private int pageNo=0;
    public final static int PAGE_NUM_BIG=10;
    public void initPage(HttpServletRequest request){
        String page_str=request.getParameter("pager.offset");
        if(StringUtils.isNotBlank(page_str)){
            pageNo=Integer.parseInt(page_str);
        }
    }

    public int getPageNo(){
        return pageNo;
    }

    public void setPageNo(int pageNo){
        this.pageNo=pageNo;
    }

    public static int getPageNumBig(){
        return PAGE_NUM_BIG;
    }

}
